# Contributor: Adam Saponara <as@php.net>
# Maintainer: Adam Saponara <as@php.net>
pkgname=mle
pkgver=1.7.2
pkgrel=0
pkgdesc="Flexible terminal-based text editor"
url="https://github.com/adsr/mle"
arch="all"
license="Apache-2.0"
makedepends="uthash-dev lua5.4-dev pcre2-dev"
checkdepends="bash grep"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/adsr/mle/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	sed -i 's/-llua5.4/-llua/g' Makefile
}

build() {
	export CFLAGS="$CFLAGS -I/usr/include/lua5.4"
	export LDFLAGS="$LDFLAGS -L/usr/lib/lua5.4"
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" prefix=/usr install
	install -d "$pkgdir/usr/share/man/man1"
	install -m644 mle.1 "$pkgdir"/usr/share/man/man1/
}

sha512sums="
14b72e9fdecb87f9aa4558269da3e0c29084c982bc353df2d8cb6b3db3b6826fb8e8e6959b9b265d87ff9236d9d3aaa100c5596ec286f5f7a77475d8c6a03e15  mle-1.7.2.tar.gz
"
